<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
	<link rel="stylesheet" type="text/css" href="__ROOT__/Index/Common/css/login.css"/>
  	<script type="text/javascript" src="__ROOT__/Index/Common/js/jquery-3.2.1.min.js"></script>
	<title>梦芭莎注册</title>
</head>
<body>
<div class="head">
    <a href="__APP__/Index/index" target="_blank">
        <p><img src="http://i0.mbscss.com/img/moonbasa/2017/xy/M4_5_134701.jpg" alt="" /></p> 
    </a>
</div>
<div class="main">
	<div class="user_frame">
	    <div class="user_info">
	        <div class="user_info_l">
	             <p><img src="http://i0.mbscss.com/img/moonbasa/2017/xy/M8_23_104640.jpg" alt="" /></p> 
	        </div>
	        <div class="user_info_r" id="dRegister">
	        		<div class="login-header">
	        			<span onclick="window.location.href='login.html'" class="login-txt_2">登录</span>
	        			<span class="login-txt" style="color:#000;">注册<span class="login_bor_1"></span></span>
	        		</div>
	        		<div class="form_style" style="height: auto;">
	        			<form id="form" method="post">
	        				<div class="f_item">
	        					<label for="txtLoginID" class="i_label name-label"></label>
	        					<input id="txtEMail" name="txtEMail" class="i_text" placeholder="邮箱" type="text" oninput="oneTip()">
	        					<div id="txtEMailTip" class="f_explain" style="display: none;">请填写邮箱</div>
	        				</div>
	        				<!--<div class="f_item">
	        					<label for="txtLoginID" class="i_label name-label"></label>
	        					<input name="txtMobile" id="txtMobile" class="i_text" placeholder="手机号" type="text" oninput="oneTip()">	
	        				</div>-->
	        				<div class="f_item">
	                        <label class="i_label pwd-label" for="txtLoginPwd"></label>
	                        <input name="txtRegPwd" id="txtRegPwd" class="i_text" placeholder="密码" maxlength="20" type="password" oninput="twoTip()">           
	                        <div id="txtRegPwdTip" class="f_explain">请输入8-20位字母和数字！</div>
                   		</div>
                   		<div class="f_item">
	                       <label class="i_label pwd-label" for="txtLoginPwd"></label>
	                        <input name="txtConfirmPwd" id="txtConfirmPwd" class="i_text" placeholder="确定密码" maxlength="20" type="password" oninput="threeTip()">           
	                        <div id="txtConfirmPwdTip" class="f_explain">请再次输入密码</div>
                   		</div>
                   		<div class="f_item reg_btn" id="dItemReg">
                        		<input name="btnRegister" id="btnRegister" class="i_btn_ok" value="注册" style="overflow:auto;" type="button" >
                    		</div>
	        			</form>
	        		</div>
	        </div>
	    </div>	
	</div>    
</div>
<div class="foot">
    <div class="footer">
        <a href="http://www.moonbasa.com/" rel="nofollow" title="女性内衣专家梦芭莎首页">首页</a> 
        <a href="http://help.moonbasa.com/help/detial/33" rel="nofollow">公司简介</a> 
        <a href="http://www.moonbasa.com/" title="梦芭莎">旗下品牌</a> 
        <a href="http://help.moonbasa.com/help/ShopMap.aspx" rel="nofollow">零售店址</a> 
        <a href="http://union.moonbasa.com" title="梦芭莎网站联盟">梦芭莎网盟</a> 
        <a href="http://fenxiao.moonbasa.com/">网店代理</a> 
        <a href="http://www.moonbasa.com/home/sitemap" target="_blank" title="梦芭莎网店代理">网站地图</a> 
        <a href="http://www.moonbasa.com/category">友情链接</a> 
        <a href="http://help.moonbasa.com/help/jop.html" title="梦芭莎评论">加入我们</a> 
        <br />
        Copyright © 2010-2019 梦芭莎官方网站，广州摩拉网络科技有限公司 All Rights Reserved 粤B2-20080069号
    </div>
</div>	
</body>
<script>
var username=document.getElementById("txtEMail");
var pwd=document.getElementById("txtRegPwd");
var confirmpwd=document.getElementById("txtConfirmPwd");
var emailTip=document.getElementById("txtEMailTip");
var pwdTip=document.getElementById("txtRegPwdTip");
var confirmTip=document.getElementById("txtConfirmPwdTip");


function oneTip(){
	if(username.value==""){
		emailTip.style.display="block";
	}else{
		emailTip.style.display="none";
	}  
}
function twoTip(){
	if(pwd.value==""){
		pwdTip.style.display="block";
	}else{
		pwdTip.style.display="none";
	}  
}
function threeTip(){
	if(confirmpwd.value==""){
		confirmTip.style.display="block";
	}else{
		confirmTip.style.display="none";
	}  
}

 
 
$("#btnRegister").click(function(){
	var reg=/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
	if(reg.test($("#txtEMail").val())){
		if($("#txtEMail").val()==""|| $("#txtRegPwd").val().length<8){
			alert("不得为空!密码不得少于8位");
		}else{
			if($("#txtRegPwd").val()==$("#txtConfirmPwd").val()){
				$.ajax({
					type:"POST",
					url:"adduser",
					data:"email="+$("#txtEMail").val()+"&pwd="+$("#txtRegPwd").val(),
					async:true,
					success:function(res){
						if(res.status==1){
							alert("注册成功");
							window.location.href="__APP__/Login/login";
						}
					}
				});
			}else{
				alert("两次输入的密码不一致！")
			}
		}
		}else{
		alert("邮箱格式错误！");
	}
	})
	





</script>
</html>